﻿#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>

typedef double Real;

typedef struct
{
	int a;
	int b;
}Rational;

typedef struct
{
	int n;
	Rational r;
}Context;
Context context = { 0 };

void read_rational(Rational* r)
{
	scanf("%d/%d", &r->a, &r->b);
}

void read_data(Context* ctx)
{
	read_rational(&ctx->r);
}

int gcd(int a, int b)
{
	int c;
	if(a<b)
	{
		c = a;
		a = b;
		b = c;
	}
	while (a%b)
	{
		c = a % b;
		a = b;
		b = c;
	}
	return b;
}

void solve(Context* ctx)
{
	int s = gcd(ctx->r.a, ctx->r.b);
	printf("%d/%d\n", ctx->r.a / s, ctx->r.b / s);
}

int main()
{
	freopen("D:/Develop/GitRepos/MOOC/浙江大学/数据结构/201906/DataStructure/M2019秋C入门和进阶练习集/7-178.txt", "r", stdin);
	read_data(&context);
	solve(&context);
	return 0;
}
